package com.ethannhu.todaynews.component.login

import android.os.Bundle
import android.text.Html
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.drake.channel.receiveEvent
import com.ethannhu.superui.util.SuperTextUtil
import com.ethannhu.todaynews.R
import com.ethannhu.todaynews.activity.BaseTitleActivity
import com.ethannhu.todaynews.activity.BaseViewModelActivity
import com.ethannhu.todaynews.component.input.InputCodeActivity
import com.ethannhu.todaynews.component.input.InputIdentityActivity
import com.ethannhu.todaynews.component.register.RegisterActivity
import com.ethannhu.todaynews.databinding.ActivityLoginHomeBinding

class LoginHomeActivity : BaseLoginActivity<ActivityLoginHomeBinding>() {

    override fun initData() {
        super.initData()
        SuperTextUtil.setLinkColor(binding.userAgreement, getColor(R.color.link))

        val content = Html.fromHtml(getString(R.string.user_agreement))
        binding.userAgreement.text = content

    }

    override fun initListeners() {
        super.initListeners()
        binding.phoneLogin.setOnClickListener {
            InputIdentityActivity.start(hostActivity)
        }
        binding.usernameLogin.setOnClickListener {
            startActivity(LoginActivity::class.java)
        }
    }

}